package org.learn.intermediate;

import java.util.Arrays;

public class ArraryMethod {
    public static void main(String[] args) {
        int[] arr = {1,3,5,2,5,6,7,8};
        //排序
        Arrays.sort(arr);
        //二叉查找
        int index = Arrays.binarySearch(arr,1);
        System.out.println(index);
        //遍历
        System.out.println( Arrays.toString(arr));
        //复制
        int[] newarr = Arrays.copyOf(arr,arr.length-1);
        System.out.println( Arrays.toString(newarr));
        //替换
        Arrays.fill(newarr,99);
        System.out.println( Arrays.toString(newarr));
        //比较
        System.out.println(Arrays.equals(arr,newarr));
        Math.sqrt(9);
    }
}
